#ifndef _LOOP_QUEUE_H_
#define _LOOP_QUEUE_H_

typedef struct _LOOP_QUEUE_s_ 
{
	UINT8 **ppBase;		
	UINT16 front;              //loop queue head
	UINT16 rear;               //loop queue tail
	UINT16 maxsize;            //loop max size
	UINT16 elesize;            //loop element size
}LOOP_QUEUE_s, *PQUEUE;

extern ULONG LoopQueue_Create(IN INT32 iQSize, IN INT32 iESize, INOUT LOOP_QUEUE_s **ppstQ);
extern BOOL LoopQueue_isFull(IN LOOP_QUEUE_s *Q);
extern BOOL LoopQueue_isEmpty(IN LOOP_QUEUE_s * Q);
extern ULONG LoopQueue_Enqueue(IN LOOP_QUEUE_s * Q, IN UINT8 *val, IN UINT16 uslen);
extern ULONG LoopQueue_GetHead(IN LOOP_QUEUE_s * Q, INOUT UINT8 *val, OUT UINT16 *pusLen);
extern ULONG LoopQueue_GetNext(IN LOOP_QUEUE_s * Q, INOUT UINT8 *val, OUT UINT16 *pusLen);
extern ULONG LoopQueue_Dequeue(IN LOOP_QUEUE_s * Q, INOUT UINT8 *val, OUT UINT16 *pusLen);
extern void LoopQueue_destory(INOUT LOOP_QUEUE_s **ppstQ);

#endif

